/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Servlets;

import beans.LoginForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import modelo.GestionProveedor;

import org.apache.struts.actions.DispatchAction;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

/**
 *
 * @author eswar@vaannila.com
 */
public class LinkAction extends DispatchAction {
    
   
    /**
     * This is the Struts action method called on
     * http://.../actionPath?method=myAction1,
     * where "method" is the value specified in <action> element : 
     * ( <action parameter="method" .../> )
     */
    public ActionForward usuario (ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        System.out.println("dentro de usuario");
        /*
        LoginForm formulario=(LoginForm) form;
        GestionProveedor gp=new GestionProveedor();
        String perfil;
       perfil=gp.validar(formulario.getNombre(), formulario.getContrasena());
        if(perfil.equals("proveedor")){
            return mapping.findForward("proveedor");
        }
        else{
        return mapping.findForward("nologin");
        }*/
        return mapping.findForward("usuario");
    }

    /**
     * This is the Struts action method called on
     * http://.../actionPath?method=myAction2,
     * where "method" is the value specified in <action> element : 
     * ( <action parameter="method" .../> )
     */
    public ActionForward nuevo (ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        return mapping.findForward("nuevo");
       
    }
    /*
    public ActionForward login (ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        return mapping.findForward("nuevo");
       
    }*/
    
        public ActionForward proveedor (ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        return mapping.findForward("proveedor");
       
    }
}